<%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<title>班级相关测试</title>
<%@ include file="/common/commonLib.jsp" %>
</head>
<body>
<center>
姓名：<input type="text" name="name"  value="一大班"/><br>
课程id：<input type="text" name="courseId"  value="1"/><br>
理论课地点:<input type="text" name="theoryLocation" value="毅字楼"  /><br>
实验课地点:<input type="text" name="labLocation" value="毅字楼"/><br>
<button id="addClass" >提交</button><br>
管理员id:<input type="text" name="managerId" value="1"><br>
fid:<input type="text" name="fid"  value="8"/><br>
<button id="addMClass">提交</button>
	<!-- private String name;
    private Integer fid;
    private Integer courseId;
    private Course course;
    private int managerId;
    private String managerName;
    private ClassType classType;
    private Integer hasTheory;
    private String theoryDateBytes;
    private ClassDate theoryDate;
    private String theoryLocation;
    private Integer hasLab;
    private String labDateBytes;
    private ClassDate labDate;
    private String labLocation;
    private Date createDate;
    private Integer createId; -->

</center>
</body>
<script>

$(document).ready(function(){
	 $("#addClass").on("click",addClass);  
	$("#addMClass").on("click",addMClass);  
})

var addClass = function (){
	
	$.post(CONTEXT_PATH+"class/ajaxCreate", {
		data : JSON.stringify(json)
	}, function(json) {
		alert(JSON.stringify(json));
	});
}
var addMClass=function (){
	var name=$("input[name='name']").val();
	var courseId=$("input[name='courseId']").val();
	var classType="MANAGETEAM";
	var managerId=$("input[name='managerId']").val();
	var fid=$("input[name='fid']").val();
	var json={
			name:name,
			courseId:courseId,
			classType:classType,
			managerId:managerId,
			fid:fid
	}
	$.post(CONTEXT_PATH+"class/ajaxCreate", {
		data : JSON.stringify(json)
	}, function(json) {
		alert(JSON.stringify(json));
	});
}
</script>
</html>